package Exer_HiHaiHi;

import java.util.*;

/**
 * @author Jimmy Zhan WORKSTATION
 * @date 2023/3/23 15:22
 * 说明：Map和Set练习
 */

public class SingerTest {
    public static void main(String[] args) {
        HashMap singers = new HashMap();

        String singer1 = "周杰伦";

        ArrayList songs1 = new ArrayList();
        songs1.add("夜曲");
        songs1.add("晴天");
        songs1.add("七里香");
        songs1.add("发如雪");
        songs1.add("屋顶");
        songs1.add("青花瓷");

        singers.put(singer1, songs1);

        String singer2 = "陈奕迅";
        ArrayList songs2 = new ArrayList();
        songs2.add("富士山下");
        songs2.add("十年");
        songs2.add("麦当劳汉堡");
        songs2.add("麦当劳薯条");
        singers.put(singer2, songs2);

        Set entrySet = singers.entrySet();
//        for (Object s: entrySet) {
//            System.out.println(s);
//        }
        Iterator iterator = entrySet.iterator();
        while (iterator.hasNext()){
            Map.Entry entry = (Map.Entry)iterator.next();
            System.out.println(entry.getKey() + "----->" + entry.getValue());
        }
    }
}
